/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package alcatelparser.tags;

import alcatelparser.modules.AlgoUtil;
import alcatelparser.modules.BuilderFactory;
import alcatelparser.modules.I;

/**
 *
 * @author geniuz
 */
public class TariffCodeTag extends DefaultParserTag
{

    public TariffCodeTag()
    {
    }

    public final void parseTag(int ai[], int i)
    {
        _array = ai;
        _startParsePosition = i;
        setStandartLength(ai, i);
        int j = AlgoUtil.getLength(_array, i + 1);
        if(isFullForm())
        {
            String s = (new StringBuilder()).append(getTagIdentifyContent(i, i + 1)).append(getHexStringContent(i + 2, j)).toString();
            BuilderFactory.getBuilder().writeTagContent(5, 0, getTagPropertiesValue(I.I(3154)), s);
            String p1 = getStringContent(i + 2, j);
            BuilderFactory.getBuilder().writeTagContent(9, 1, "", (new StringBuilder()).append(I.I(5979)).append(p1).toString());
        } else
        if(isTagChecked(I.I(3143)))
        {
            String s1 = isFieldsDecoding() ? getStringContent(i + 2, j) : getHexStringContent(i + 2, j);
            BuilderFactory.getBuilder().writeTagContent(1, 0, getReducedTagPropertiesValue(I.I(3154)), s1);
        }
    }
}
